package org.nobody.mallb2c.mallcart.vo;

/**
 * @author 3489309323@qq.com
 * @create 2020-09-19-16:14
 */

import lombok.Data;

import java.math.BigDecimal;
import java.util.List;

/**
 * 购物车里的一项
 *
 * 每一项的详细信息
 */
public class CartItem {
  private Long skuId;
  private Boolean check = true;
  private String title;
  private String image;
  private List<String> skuAttr;
  private BigDecimal price;
  private Integer count;
  private BigDecimal totalPrice;

  public Long getSkuId() {
    return skuId;
  }

  public void setSkuId(Long skuId) {
    this.skuId = skuId;
  }

  public Boolean getCheck() {
    return check;
  }

  public void setCheck(Boolean check) {
    this.check = check;
  }

  public String getTitle() {
    return title;
  }

  public void setTitle(String title) {
    this.title = title;
  }

  public String getImage() {
    return image;
  }

  public void setImage(String image) {
    this.image = image;
  }

  public List<String> getSkuAttr() {
    return skuAttr;
  }

  public void setSkuAttr(List<String> skuAttr) {
    this.skuAttr = skuAttr;
  }

  public BigDecimal getPrice() {
    return price;
  }

  public void setPrice(BigDecimal price) {
    this.price = price;
  }

  public Integer getCount() {
    return count;
  }

  public void setCount(Integer count) {
    this.count = count;
  }

  /**
   * 计算当前项的总价
   * @return
   */
  public BigDecimal getTotalPrice() {
    return this.price.multiply(new BigDecimal("" + this.count));
  }
}
